package com.example.demo.controller;

import com.example.demo.service.IGroupWorkFlowService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * 把组任务单独拿了出来
 */

@RestController
@RequestMapping("groupWorkFlow")
public class GroupWorkFlowControl {
    @Autowired
    private IGroupWorkFlowService groupWorkFlowService;


    @ApiOperation(value = "拾取任务",notes = "")
    @GetMapping("claim")
    public ResponseEntity claim(@RequestParam("taskId") String taskId,
                                @RequestParam("userId") String userId){
        groupWorkFlowService.claim(taskId, userId);
        return ResponseEntity.ok(true);
    }
}
